$(function(){
	$.each($(".monthpicker"),function(idx,val){
		$("#"+val.id).datepicker({
			showOn: "button",
			showButtonPanel: true,
			buttonImageOnly: true,
			buttonImage: base_url+"assets/img/calendar.png",
			dateFormat:"dd MM yy",
			altField: "#"+val.id+"-value",
			altFormat: "yy-mm-dd",
			changeMonth: true,
			changeYear: true
		}).css("width","140px");
	}); 
	$("#report-type").change(function(){
		$("#report-type option:selected").each(function(){
			if (parseInt($(this).val()) == 1 && !vacancy) {
				$(".report-title").show();
			} else {
				$(".report-title").hide();
			}
		});
	})
});

function exportExcel(table) {
	var param="/"+$("#dateFrom-value").val()+"/"+$("#dateTo-value").val();
	window.location = base_url+"administrator/reports/"+table+"_table"+param+"/excel";
}

